// 接口列表文件
var ssEnv = "DEV" // DEV:开发环境  TEST：测试环境  PRE：预发布环境

var ismock = 0;// 0-不使用mock  1-使用mock  不传默认为0
var api = {
  "api_better_departure":"/better_departure",//2.2.1 定位出发城市接口
  "api_schedule_topdepartcitys": "/schedule/topdepartcitys/0",//2.2.3 获取汽车票热门出发地接口
  "api_schedule_reachrecommend":"/schedule/reachrecommend/0",//2.2.5 获取目的地热门接口
  "api_departure":"/departure/0",//2.2.4根据关键字查询出发地接口
  "api_order_findpreparedata":"/order/findpreparedata/0",//2.2.10订单填写页面数据准备
  "api_order_checkorder":"/order/checkorder/0",//2.2.11检查订单接口
}

function getApi(name) {
  var host;

  switch (ssEnv) {
    case "DEV":
      host = "http://wwwd.bus365.cn";
      break;
    case "MOCK":
      host = "http://mraw.bus365.cn";
      break;
    case 'TEST':
      host = "";
      break;
    case 'PRE':
      host = "";
      break;
    default:
      host = "";
      break;
  }
  return host + api[name];
}

module.exports = {
  getApi: getApi
}